//token
const tokenName = 'TOKEN';
const userInfo = 'USER_INFO'

// 设置token
export let setToken = token => localStorage.setItem(tokenName, token);

// 获取token
export let getToken = () => localStorage.getItem(tokenName);

// 删除token
export let delToken = () => localStorage.removeItem(tokenName);

// 设置用户信息存储 - session

export let setUser = user => sessionStorage.setItem(userInfo, JSON.stringify(user));

export let getUser = () => JSON.parse(sessionStorage.getItem(userInfo));

export let delUser = () => sessionStorage.removeItem(userInfo)